export * from "./toDisplayString";

export const extend = Object.assign;

// 创建空对象
export const EMPTY_OBJ = {};

export const isObject = (val) => val !== null && typeof val === 'object';

export const hasChanged = (val, oldVal) => {
    return !Object.is(val, oldVal)
};

export const hasOwn = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);

// 转换驼峰命名
export const camelize = (str: string) => str.replace(/-(\w)/g, (match, letter) => letter.toUpperCase());

// 转换首字母大写
export const capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);

// 转换方法为on+xxx
export const toHandlerKey = (str: string) => {
    return str ? "on" + capitalize(str) : "";
}